@import url('./iconfont/iconfont.css');

:root {
  --v-theme: #0ab39c;
  --v-theme-dark: #099a87;
  --v-success: #28C76F;
  --v-danger: #EA5455;
  --v-warning: #FF9F43;
  --v-card-radius: 6px;
  --v-shadow: rgba(14, 63, 126, 0.04) 0px 0px 0px 1px, rgba(42, 51, 69, 0.04) 0px 1px 1px -0.5px, rgba(42, 51, 70, 0.04) 0px 3px 3px -1.5px, rgba(42, 51, 70, 0.04) 0px 6px 6px -3px, rgba(14, 63, 126, 0.04) 0px 12px 12px -6px, rgba(14, 63, 126, 0.04) 0px 24px 24px -12px;
  --v-text: #495057;
  --v-text-lighter: #878a99;
  --v-text-darker: #181E34;
  --v-background: #f7f8fa;
  --v-background-pure: #fff;
  --v-side-width: 250px;
  --v-card-bg: #fff;
  --v-border-color: #eee;
  --v-sidebar-background: #405189;
  --v-link: #2F3A64;
}

/* 暗黑模式全局样式 */
.dark {
  --v-text-darker: #212529;
  --v-background-pure: #1C1F2B;
  --v-sidebar-background: #405189;
  --v-background: #252b42;
  --v-card-bg: #2f3650;
  --v-text: #abb9c8;
  --v-text-lighter: #e1e5ee;
  --v-border-color: #3C4464;
  --v-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --v-text-darker: #fff;
  --v-link: #abb9e8;
  --v-theme-dark: #078272;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  scrollbar-width: thin;
  scrollbar-color: rgba(128, 128, 128, 0.5) rgba(200, 200, 200, 0.1);
}

html {
  overflow-x: hidden;
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--v-background);
  height: 100%;
  color: var(--v-text);
  transition: color .3s background-color .3s;
}

/* 美化滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(200, 200, 200, 0.1);
  border-radius: var(--v-card-radius);
}

::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.5);
  border-radius: var(--v-card-radius);
  border: 2px solid rgba(0, 0, 0, 0);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(128, 128, 128, 0.8);
}

a {
  color: var(--v-link);
  text-decoration: none;
  transition: all .6s;

  &:hover {
    color: var(--v-theme);
  }
}

input,
textatea,
button {
  outline: none;
}

/* 移除侧边栏和主内容区之间的空隙 */
.app-container {
  height: 100vh;
  overflow: hidden;
}

.content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* 防止内容溢出导致滚动条 */
}

.main-content {
  overflow-y: auto;
  /* 只有主内容区可以滚动 */
}

.page-view {

  .page-title {
    color: var(--v-text-darker);
    font-size: 24px;
    font-weight: 200;
    margin: 0;
  }

  .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
  }

  .chart-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
  }

  .chart-container {
    border: 1px solid var(--v-border-color);
    background: var(--v-card-bg);
    border-radius: var(--v-card-radius);
    box-shadow: var(--v-shadow);
    padding: 25px;
    margin-bottom: 30px;
    transition: all .3s;
  }

  .chart-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
  }

  .chart-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--v-text-darker);
    transition: color .3s;
  }

  .chart-filter {
    background: var(--v-background);
    padding: 8px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--v-text-lighter);
    transition: background-color .3s, color .3s;
  }

  .v-table {
    width: 100%;
    border-collapse: collapse;
  }

  .v-table th {
    text-align: left;
    padding: 15px 10px;
    font-weight: 600;
    color: var(--v-text-darker);
    border-bottom: 1px solid var(--v-border-color);
    transition: border-color .3s;
  }

  .v-table td {
    padding: 15px 10px;
    border-bottom: 1px solid var(--v-border-color);
    transition: border-color .3s;
  }

  .v-table tbody tr {
    transition: all 0.2s ease;
  }

  .v-table tbody tr:hover {
    background-color: var(--v-background);
  }

  @media (max-width: 1200px) {
    .stats-grid {
      grid-template-columns: repeat(2, 1fr);
    }

    .chart-grid {
      grid-template-columns: 1fr;
    }
  }

  @media (max-width: 768px) {
    .stats-grid {
      grid-template-columns: 1fr;
    }
  }

  /* 响应式工具 */
  @media (max-width: 768px) {
    .mobile\:hidden {
      display: none;
    }
  }
}

.dark .sidebar {
  background: linear-gradient(180deg, var(--v-card-bg) 0%, var(--v-background) 100%);
}

.dark .country-name,
.dark .country-revenue {
  color: var(--v-text);
}

.dark .card-value,
.dark .country-change.positive,
.dark .country-change.negative {
  color: var(--v-text-lighter);
}


/* 暗黑模式下的按钮 */
.dark .btn {
  background: #4f46e5;
  color: white;
}

.dark .btn:hover {
  background: #4338ca;
}

/* 暗黑模式下的表格 */
.dark .recent-transactions {
  color: var(--v-text);
}

.dark .recent-transactions th,
.dark .recent-transactions td {
  border-color: var(--v-border-color);
}

.dark .recent-transactions tr {
  background-color: var(--v-card-bg);
}

.dark .recent-transactions tr:hover {
  background-color: #4b5563;
}

/* 暗黑模式下的下拉菜单 */
.dark .chart-filter {
  background: #374151;
  color: var(--v-text-lighter);
}

.dark .topbar {
  background-color: var(--v-card-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.breadcrumb {
  display: flex;
  justify-content: space-between;
  align-items: center;

  .list {
    background: var(--v-card-bg);
    border: var(--v-border-color) 1px solid;
    border-radius: 4px;
    display: flex;
    align-items: center;
    font-size: 14px;
    transition: background-color .3s, border-color .3s;
    box-shadow: var(--v-shadow);
    padding-right: 10px;

    // .seperate {}

    .home-icon {
      width: 38px;
      height: 38px;
      display: flex;
      justify-content: center;
      align-items: center;
      border-right: var(--v-border-color) 1px solid;
      transition: border-color .3s;
    }

    .item {
      height: 38px;
      line-height: 38px;
      padding: 0 10px;
      transition: border-color .3s, color .3s;

      &:nth-child(2) {
        border-left: rgba(0, 0, 0, .1) 1px solid;
      }
    }
  }

  .page-title {
    padding-right: 30px;
  }

  margin-bottom: 25px;
}

/* 表单基础样式 */
.form-container {
  background-color: var(--v-card-bg);
  border-radius: var(--v-card-radius);
  box-shadow: var(--v-shadow);
  padding: 20px;
  margin-top: 20px;
}

/* 表单网格布局 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group.full-width {
  grid-column: span 2;
}

/* 表单标签 */
.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--v-text-darker);
}

/* 输入框样式 */
.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--v-border-color);
  border-radius: 4px;
  background: var(--v-card-bg);
  color: var(--v-text);
  outline: none;
  transition: border-color 0.3s;
  font-size: 14px;
}

.form-input:focus {
  border-color: var(--v-theme);
}

.form-input[readonly] {
  background-color: var(--v-bg-light);
  cursor: pointer;
}

/* 文本域样式 */
.form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--v-border-color);
  border-radius: 4px;
  background: var(--v-card-bg);
  color: var(--v-text);
  outline: none;
  min-height: 100px;
  resize: vertical;
  transition: border-color 0.3s;
  font-size: 14px;
}

.form-textarea:focus {
  border-color: var(--v-theme);
}

/* 按钮基础样式 - 统一所有操作按钮样式 */
:root {
  --v-btn-radius: 3px; /* 统一设置所有按钮圆角为3px */
}

/* 统一所有操作按钮样式 - 以删除按钮为基准 */
.v-button,
.v-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 8px 16px !important;
  border: 1px solid var(--v-border-color) !important;
  background: transparent !important;
  border-radius: var(--v-btn-radius) !important;
  color: var(--v-text-primary) !important;
  font-size: 13px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  white-space: nowrap !important;
  height: 36px !important;
  min-width: auto !important;
}

.v-button i,
.v-btn i {
  margin-right: 4px !important;
  font-size: 14px !important;
}

.v-button:hover:not(:disabled),
.v-btn:hover:not(:disabled) {
  border-color: var(--v-theme) !important;
  color: var(--v-theme) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.v-button:disabled,
.v-btn:disabled {
  cursor: not-allowed !important;
  opacity: 0.6 !important;
}

/* 按钮变体 */
.v-button.primary,
.v-btn.primary {
  background: var(--v-theme) !important;
  color: white !important;
  border-color: var(--v-theme) !important;
}

.v-button.primary:hover:not(:disabled),
.v-btn.primary:hover:not(:disabled) {
  background: var(--v-theme-dark) !important;
  border-color: var(--v-theme-dark) !important;
  color: white !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.v-button.outline,
.v-btn.outline {
  background: transparent !important;
  border-color: var(--v-border-color) !important;
  color: var(--v-text) !important;
}

.v-button.outline:hover,
.v-btn.outline:hover {
  background: var(--v-hover-bg) !important;
}

.v-button.link,
.v-btn.link {
  background: transparent !important;
  border: none !important;
  color: var(--v-theme) !important;
  padding: 0 8px !important;
  height: auto !important;
}

.v-button.link:hover,
.v-btn.link:hover {
  text-decoration: underline !important;
}

/* 删除按钮样式 - 基准样式 */
.v-button.danger,
.v-btn.danger {
  border-color: var(--v-danger) !important;
  color: var(--v-danger) !important;
}

.v-button.danger:hover:not(:disabled),
.v-btn.danger:hover:not(:disabled) {
  background: rgba(234, 84, 85, 0.05) !important;
  border-color: var(--v-danger) !important;
}

/* 编辑按钮样式 - 绿色 */
.v-button.success,
.v-btn.success {
  border-color: var(--v-success) !important;
  color: var(--v-success) !important;
}

.v-button.success:hover:not(:disabled),
.v-btn.success:hover:not(:disabled) {
  background: rgba(40, 199, 111, 0.05) !important;
  border-color: var(--v-success) !important;
}

/* 禁用按钮样式 - 橙色 */
.v-button.warning,
.v-btn.warning {
  border-color: var(--v-warning) !important;
  color: var(--v-warning) !important;
}

.v-button.warning:hover:not(:disabled),
.v-btn.warning:hover:not(:disabled) {
  background: rgba(255, 159, 67, 0.05) !important;
  border-color: var(--v-warning) !important;
}

/* 禁用状态 */
.v-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 表单操作按钮 */
.form-actions {
  margin-top: 30px;
  text-align: center;
}

.form-actions .v-button {
  margin: 0 10px;
}

/* 表格样式 */
.v-table {
  width: 100%;
  border-collapse: collapse;
}

.v-table th,
.v-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--v-border-color);
}

.v-table th {
  font-weight: 500;
  color: var(--v-text-light);
  background-color: var(--v-bg-light);
}

.v-table tr:hover td {
  background-color: var(--v-hover-bg);
}

/* 空数据提示 */
.empty-row {
  text-align: center;
  padding: 20px;
  color: var(--v-text-light);
}

.empty-row .iconfont {
  font-size: 48px;
  margin-bottom: 10px;
  display: block;
}

/* 日期选择器包装 */
.date-picker-wrapper {
  position: relative;
}

/* 卡片样式 */
.v-card {
  margin-bottom: 20px;
  border-radius: var(--v-card-radius);
  background: var(--v-card-bg);
  box-shadow: var(--v-shadow);
}

.v-card .card-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--v-border-color);
}

.v-card .card-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.v-card .card-body {
  padding: 20px;
}

/* 图片上传器 */
.image-uploader {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-area {
  width: 150px;
  height: 150px;
  border: 1px dashed var(--v-border-color);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

.upload-area .iconfont {
  font-size: 18px;
  color: var(--v-text-light);
}

.preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-group.full-width {
    grid-column: span 1;
  }
}

/* 分页容器 */
.pagination-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--v-border-color);
}

/* 分页按钮组 */
.v-pagination {
  display: flex;
  gap: 8px;
}

/* 分页按钮 */
.v-pagination .v-button {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--v-border-color);
  background-color: var(--v-card-bg);
  color: var(--v-text);
}

.v-pagination .v-button:hover:not(:disabled) {
  color: var(--v-theme);
  border-color: var(--v-theme);
}

.v-pagination .v-button.primary {
  background-color: var(--v-theme);
  color: white;
  border-color: var(--v-theme);
}

.v-pagination .v-button.primary:hover {
  opacity: 0.9;
}

.v-pagination .v-button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 分页信息 */
.page-info {
  color: var(--v-text-light);
  font-size: 14px;
}

/* 分页尺寸选择器 */
.page-size-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-size-selector .form-label {
  margin: 0;
  white-space: nowrap;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .pagination-wrapper {
    flex-direction: column;
    gap: 15px;
  }

  .page-info {
    order: -1;
  }
}

/* 操作栏样式 */
.action-bar {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  gap: 15px;
  flex-wrap: wrap;
}

.action-bar .v-button {
  margin-right: 10px;
}

.search-wrapper {
  flex: 1;
  max-width: 300px;
  margin-left: auto;
}

.search-input {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--v-card-bg);
  border-radius: var(--v-card-radius);
  border: 1px solid var(--v-border-color);
  padding: 0 10px;
  height: 36px;
}

.search-input i {
  color: var(--v-text-light);
  margin-right: 8px;
}

.search-input input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  color: var(--v-text);
}

.search-input .icon-close {
  cursor: pointer;
  margin-left: 8px;
}

.search-input .icon-close:hover {
  color: var(--v-danger);
}

/* 筛选栏样式 */
.filter-bar {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  gap: 15px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 14px;
  color: var(--v-text-darker);
  white-space: nowrap;
}

.date-picker-wrapper {
  position: relative;
}

.date-picker-wrapper .form-input {
  width: 120px;
  padding: 8px 12px;
  cursor: pointer;
}

.date-separator {
  color: var(--v-text-light);
  padding: 0 5px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .action-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-wrapper {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-top: 10px;
  }

  .filter-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-group {
    width: 100%;
    flex-wrap: wrap;
  }

  .date-picker-wrapper {
    flex: 1;
  }

  .date-picker-wrapper .form-input {
    width: 100%;
  }
}

.v-container {
  background-color: var(--v-card-bg);
  border-radius: var(--v-card-radius);
  box-shadow: var(--v-shadow);
  padding: 20px;
  margin-top: 30px;
  transition: all 0.3s;
}

.date-picker-wrapper {
  background-color: var(--v-card-bg);
}

/* 全局表单样式 */
.v-form {
  .form-group {
    margin-bottom: 16px;
  }
  
  .form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--v-text);
  }
  
  .form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--v-border-color);
    border-radius: var(--v-card-radius);
    background: var(--v-card-bg);
    color: var(--v-text);
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    box-sizing: border-box;
  }
  
  .form-input:focus {
    border-color: var(--v-theme);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
  }
  
  .form-input::placeholder {
    color: var(--v-text-light);
  }
  
  .form-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--v-border-color);
    border-radius: var(--v-card-radius);
    background: var(--v-card-bg);
    color: var(--v-text);
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: all 0.3s;
    box-sizing: border-box;
  }
  
  .form-select:focus {
    border-color: var(--v-theme);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
  }
  
  /* 只读表单元素样式 */
  .form-readonly {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--v-border-color);
    border-radius: var(--v-card-radius);
    background: var(--v-card-bg);
    color: var(--v-text);
    font-size: 14px;
    box-sizing: border-box;
    min-height: 36px;
    display: flex;
    align-items: center;
  }
  
  /* 全局只读输入框样式 - 用于body顶层弹窗 */
  .form-input.readonly {
    width: 100% !important;
    padding: 8px 12px !important;
    background-color: var(--v-background) !important;
    color: var(--v-text-lighter) !important;
    border: 1px solid var(--v-border-color) !important;
    border-radius: var(--v-card-radius) !important;
    cursor: not-allowed !important;
    box-sizing: border-box !important;
    display: block !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif !important;
  }
  
  /* 确保全局只读样式生效 */
  body .form-input.readonly {
    width: 100% !important;
    padding: 8px 12px !important;
    background-color: var(--v-background) !important;
    color: var(--v-text-lighter) !important;
    border: 1px solid var(--v-border-color) !important;
    border-radius: var(--v-card-radius) !important;
    cursor: not-allowed !important;
  }
  
  /* 两列表单布局 */
  &.double-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  
  /* 确保表单元素在grid布局中正确显示 */
  &.double-col .form-group {
    margin-bottom: 0;
  }
   .toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .toggle-label {
    font-size: 14px;
    color: var(--v-text);
  }
}
